﻿/* This code is restricted under LGPL license */
using NHibernate.Criterion;

namespace infoMECHANICA.NHibernateORM.CriteriaBuilder
{    
    /// <summary>
    /// Interface of objects which can create detached criteria
    /// </summary>
    public interface ICriteriaSource
    {
        /// <summary>
        /// Extract detached crteria from this source
        /// </summary>
        /// <returns>NHibernate detached criteria</returns>
        DetachedCriteria BuildCriteria();

        /// <summary>
        /// Extract detached crteria from this source
        /// </summary>
        /// <returns>NHibernate detached criteria</returns>
        DetachedCriteria BuildCriteria(string alias);

        /// <summary>
        /// Whether its possible to create subcriteria from this source?
        /// </summary>
        /// <returns></returns>
        bool HasCriteria();
    }
}
